#ifndef FACE_BEAUTY_DIALOG_H
#define FACE_BEAUTY_DIALOG_H

#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QDialog>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QOpenGLWidget>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSlider>
#include <QtGui/QPainter>
#include <QtGui/QImage>
#include <QtCore/QThread>
#include <QtMultimedia/QCamera>
#include <QtMultimediaWidgets/QCameraViewfinder>
#include <memory>

#include "ui_face_beauty.h"
#include "face_beauty_canvas.h"
#include "image_filter_worker.h"

class FaceBeautyDialog: public QDialog
{
    Q_OBJECT

public:
    FaceBeautyDialog();
    virtual ~FaceBeautyDialog();

private slots:
    bool OpenPhoto();
    bool OpenCamera();
    void CloseCamera();
    int PaintImage(QImage *img);

    void BuffingValueChanged();
    void WhiteningValueChanged();
    void ThinFaceValueChanged();
    void BigEyeValueChanged();

    void CameraStatusChanged(QCamera::Status s);

signals:
    int ToProccessFrame(QImage* img);

private:
    void RetranslateUi(QDialog *Dialog);
    void SetupSignal();
    void SetupFilter();
    void SetupCamera();
    void PhotoReopen();

    Ui_Dialog* ui_;

    std::shared_ptr<FaceBeautyViewFinder> view_finder_;
    std::shared_ptr<QCamera> camera_;
    std::shared_ptr<ImageFilterWorker> filter_;

    bool photo_opened_;
    QString photo_opened_path_;
};

#endif // FACE_BEAUTY_DIALOG_H
